package com.dys.ai.common.api;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serial;
import java.io.Serializable;

/**
 * 封装API响应结果的标准模型
 */
public class ResponseEntity implements Serializable {

    /**
     * 序列化编号
     */
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 由后端统一定义各种返回结果的状态码
     */
    private Integer code;

    /**
     * 本次接口调用的结果描述
     */
    private String message;

    /**
     * 本次调用接口返回的数据
     */
    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private Object data;

    public ResponseEntity() {
    }

    public ResponseEntity(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseEntity(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
